from django.db import models

# Create your models here.
from django.db import models

class Clazz(models.Model):
    """班级"""
    name = models.CharField(max_length=100, unique=True, verbose_name='班级名称')
    code = models.CharField(max_length=20, unique=True, verbose_name='班级编号')
    department = models.ForeignKey('department.Department', on_delete=models.CASCADE,
                                   related_name='classes',
                                   verbose_name='所属系部')
    created_at = models.DateTimeField(auto_now_add=True, verbose_name='创建时间')

    class Meta:
        db_table = 'tb_clazz'
        verbose_name = '班级'
        verbose_name_plural = verbose_name

    def __str__(self):
        return self.name